﻿namespace = journal_flavor_switzerland

journal_flavor_switzerland.1 = { 
	type = country_event
	placement = ROOT

	title = journal_flavor_switzerland.1.t
	desc = journal_flavor_switzerland.1.d
	flavor = journal_flavor_switzerland.1.f

	event_image = {
		video = "gfx/event_pictures/unspecific_military_parade.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/unspecific/military_parade"

	icon = "gfx/interface/icons/event_icons/event_centralization.dds"

	duration = 1

	immediate = {
	}

	option = {
		name = journal_flavor_switzerland.1.a
		default_option = yes
		
		change_tag = SWI

		every_country = {
			limit = {
				is_subject_type = subject_type_confederation
				overlord = ROOT
				is_player = no
			}
			save_scope_as = annex_scope
			ROOT = {
				annex = scope:annex_scope
			}
		}

	    ai_chance = {
			base = 1	
		}
    }
}

journal_flavor_switzerland.2 = { 
	type = country_event
	placement = ROOT

	title = journal_flavor_switzerland.2.t
	desc = journal_flavor_switzerland.2.d
	flavor = journal_flavor_switzerland.2.f

	event_image = {
		video = "gfx/event_pictures/unspecific_politicians_arguing.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/africa/leader_arguing"

	icon = "gfx/interface/icons/event_icons/event_revolt.dds"

	duration = 1

	immediate = {
		if = {
			limit = {
				exists = c:API
				c:API = {
					is_subject_of = ROOT
					is_subject_type = subject_type_confederation
				}
			}
			remove_diplomatic_pact = {
				country = c:API
				type = confederation
			}
		}
		if = {
			limit = {
				exists = c:NTL
				c:NTL = {
					is_subject_of = ROOT
					is_subject_type = subject_type_confederation
				}
			}
			remove_diplomatic_pact = {
				country = c:NTL
				type = confederation
			}
		}



		if = {
			limit = {
				country_has_state_religion = rel:reformed
			}
			every_country = {
				limit = {
					is_subject_type = subject_type_confederation
					overlord = ROOT
					OR = {
						country_has_state_religion = rel:reformed
						this = c:TIC
					}
					
					is_player = no
				}
				save_scope_as = annex_scope
				ROOT = {
					annex = scope:annex_scope
				}
			}
			if = {
				limit = {
					any_country = {
						country_has_primary_culture = cu:swiss
						country_has_state_religion = rel:catholic
						is_player = yes
						NOT = { this = c:API }
						NOT = { this = c:NTL }
					}
				}
				random_country = {
					limit = {
						country_has_primary_culture = cu:swiss
						country_has_state_religion = rel:catholic
						is_player = yes
						NOT = { this = c:API }
						NOT = { this = c:NTL }

					}
					save_scope_as = sonderbund_leader
	
					ROOT = {
						remove_diplomatic_pact = {
							country = scope:sonderbund_leader
							type = confederation
						}
					}
	
					every_country = {
						limit = {
							is_subject_type = subject_type_confederation
							overlord = ROOT
							country_has_state_religion = rel:catholic
							is_player = no
							NOT = {this = c:TIC}
						}
						save_scope_as = sonderbund_annex_scope
						scope:sonderbund_leader = {
							annex = scope:sonderbund_annex_scope
						}
					}
				}
			}
			else = {
				random_country = {

					limit = {
						country_has_primary_culture = cu:swiss
						country_has_state_religion = rel:catholic
						NOT = { this = c:API }
						NOT = { this = c:NTL }
					}
					save_scope_as = sonderbund_leader
	
					ROOT = {
						remove_diplomatic_pact = {
							country = scope:sonderbund_leader
							type = confederation
						}
					}
	
					every_country = {
						limit = {
							is_subject_type = subject_type_confederation
							overlord = ROOT
							country_has_state_religion = rel:catholic
							is_player = no
							NOT = {this = c:TIC}
						}
						save_scope_as = sonderbund_annex_scope
						scope:sonderbund_leader = {
							annex = scope:sonderbund_annex_scope
						}
					}
				}
			}

		}
		else = {
			every_country = {
				limit = {
					is_subject_type = subject_type_confederation
					overlord = ROOT
					country_has_state_religion = rel:catholic
					is_player = no
					NOT = {this = c:TIC}
				}
				save_scope_as = annex_scope
				ROOT = {
					annex = scope:annex_scope
				}
			}
			if = {
				limit = {
					any_country = {
						country_has_primary_culture = cu:swiss
						country_has_state_religion = rel:reformed
						is_player = yes
					}
				}
				random_country = {
					limit = {
						country_has_primary_culture = cu:swiss
						country_has_state_religion = rel:reformed
						is_player = yes
						NOT = { this = c:API }
						NOT = { this = c:NTL }
					}
					save_scope_as = sonderbund_leader
	
					ROOT = {
						remove_diplomatic_pact = {
							country = scope:sonderbund_leader
							type = confederation
						}
					}
					every_country = {
						limit = {
							is_subject_type = subject_type_confederation
							overlord = ROOT
							OR = {
								country_has_state_religion = rel:reformed'
								this = c:TIC
							}
							is_player = no
						}
						save_scope_as = sonderbund_annex_scope
						scope:sonderbund_leader = {
							annex = scope:sonderbund_annex_scope
						}
					}
				}
			}
			else = {
				random_country = {
					limit = {
						country_has_primary_culture = cu:swiss
						country_has_state_religion = rel:reformed
					}
					save_scope_as = sonderbund_leader
					ROOT = {
						remove_diplomatic_pact = {
							country = scope:sonderbund_leader
							type = confederation
						}
					}

					every_country = {
						limit = {
							is_subject_type = subject_type_confederation
							overlord = ROOT
							OR = {
								country_has_state_religion = rel:reformed
								this = c:TIC
							}
							is_player = no
						}
						save_scope_as = sonderbund_annex_scope
						scope:sonderbund_leader = {
							annex = scope:sonderbund_annex_scope
						}
					}
				}
			}

		}
		if = {
			limit = {
				country_has_state_religion = rel:catholic
			}
			scope:sonderbund_leader = {
				random_scope_pop = {
					limit = { 
							religion = rel:reformed
					}
					religion = {
						save_scope_as = discriminated_religion_scope
					}
				}
			}
		}
		else = {
			scope:sonderbund_leader = {
				random_scope_pop = {
					limit = { 
							religion = rel:catholic
					}
					religion = {
						save_scope_as = discriminated_religion_scope
					}
				}
			}
		}


	}

	option = {
		name = journal_flavor_switzerland.2.a
		default_option = yes
		
		change_tag = SWI

		scope:sonderbund_leader = {
			create_diplomatic_play = {
				target_country = ROOT
				war = yes
				type = dp_revolution
			}
			add_journal_entry = {
				type = je_sonderbund_war
			}
		}
		add_journal_entry = {
			type = je_sonderbund_war
		}
		show_as_tooltip = {
			if = {
				limit = {
					country_has_state_religion = rel:reformed
				}
				every_country = {
					limit = {
						is_subject_type = subject_type_confederation
						overlord = ROOT
						OR = {
							country_has_state_religion = rel:reformed
							this = c:TIC
						}
						
						is_player = no
					}
					save_scope_as = annex_scope
					ROOT = {
						annex = scope:annex_scope
					}
				}
			}
			else = {
				every_country = {
					limit = {
						is_subject_type = subject_type_confederation
						overlord = ROOT
						country_has_state_religion = rel:catholic
						is_player = no
						NOT = {this = c:TIC}
					}
					save_scope_as = annex_scope
					ROOT = {
						annex = scope:annex_scope
					}
				}
	
			}
		}


	    ai_chance = {
			base = 1	
		}
    }
	option = {
		name = journal_flavor_switzerland.2.b
		default_option = yes
		
		change_tag = SWI

		show_as_tooltip = {
			if = {
				limit = {
					country_has_state_religion = rel:reformed
				}
				every_country = {
					limit = {
						is_subject_type = subject_type_confederation
						overlord = ROOT
						OR = {
							country_has_state_religion = rel:reformed
							this = c:TIC
						}
						
						is_player = no
					}
					save_scope_as = annex_scope
					ROOT = {
						annex = scope:annex_scope
					}
				}
			}
			else = {
				every_country = {
					limit = {
						is_subject_type = subject_type_confederation
						overlord = ROOT
						country_has_state_religion = rel:catholic
						is_player = no
						NOT = {this = c:TIC}
					}
					save_scope_as = annex_scope
					ROOT = {
						annex = scope:annex_scope
					}
				}
	
			}
		}


	    ai_chance = {
			base = 1	
		}
    }
	option = {
		name = journal_flavor_switzerland.2.c
		default_option = yes
		
		change_tag = SWI

		scope:sonderbund_leader = {
			create_diplomatic_play = {
				target_country = ROOT
				war = yes
				type = dp_revolution
			}
			add_journal_entry = {
				type = je_sonderbund_war
			}
		}
		add_journal_entry = {
			type = je_sonderbund_war
		}

		play_as = scope:sonderbund_leader

		
		show_as_tooltip = {
			if = {
				limit = {
					country_has_state_religion = rel:reformed
				}
				every_country = {
					limit = {
						is_subject_type = subject_type_confederation
						overlord = ROOT
						OR = {
							country_has_state_religion = rel:reformed
							this = c:TIC
						}
						
						is_player = no
					}
					save_scope_as = annex_scope
					ROOT = {
						annex = scope:annex_scope
					}
				}
			}
			else = {
				every_country = {
					limit = {
						is_subject_type = subject_type_confederation
						overlord = ROOT
						country_has_state_religion = rel:catholic
						is_player = no
						NOT = {this = c:TIC}
					}
					save_scope_as = annex_scope
					ROOT = {
						annex = scope:annex_scope
					}
				}
	
			}
		}

	    ai_chance = {
			base = 1	
		}
    }
}